package com.hsylient.simplefactory;

import java.util.Objects;

/**
 * @Description
 * @Author Hsylient
 * @Date 2022/12/19/15:37
 */
public class SimpleFactory {
    public static Pizza getInstance(String pizzaName) {
        if (pizzaName == null || pizzaName.equals("")) {
            return null;
        } else if (Objects.equals(pizzaName, "chinesePizza")){
            return new CheesePizza();
        } else if (Objects.equals(pizzaName, "japanPizza")) {
            return new JapanPizza();
        }
        return null;
    }
}
